<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>v_model绑定radio</title>
</head>
<body>
  <div id="app">
    <div class="gender">
      <label for="male">
        <input id="male" type="radio" name="gender22" v-model="gender" value="male2"> 男 <!--使用同一个name,那么在同一个div里面只能选中其中一个-->
      </label>
      <label for="female">
        <!--<input id="female" type="radio" name="gender22" v-model="gender" value="female2"> 女 使用v-model后可以不用name-->
        <input id="female" type="radio" v-model="gender" value="female2"> 女 <!--使用v-model后可以不用name-->
      </label>
      <h2>性别: {{gender}}</h2>
    </div>
  </div>
  
  <script src="../lib/vue.js"></script>
  <script>
    // 使用vue
    const app = Vue.createApp({
      data: function(){
        return {
          gender: ""
        }
      }
      ,methods: {
      },
      computed: {
        
      },
      watch: {
       
      }
    }
    )
    // 挂载 
    app.mount("#app")
  </script>

</body>
</html>
